﻿
using System ;

using MskEdit.Sdk ;
using MskEdit.Dxf.Representation ;


namespace MskEdit.Dxf.Model
{

    public class DxfTextEntity : DxfEntity
    {
        private static DxfSignature         signature_      = new DxfSignature( "0", "TEXT", "0", "" ) ;
        private static ConstructorHandler   constructor_    = (a, b) => { return new DxfTextEntity(a, b) ; } ;


        private DxfTextEntity( string[] allLines, SdkSubrange subrange ) : base( allLines, subrange ) {
        }


        public static DxfTextEntity TryFrom( string[] allLines, ref int lineNo, DxfTextEntity fallbackValue ) {
            return (DxfTextEntity) DxfStructBase.TryConstruct( allLines, ref lineNo, signature_, constructor_, fallbackValue ) ;
        }

        
        public string Text {
            get { return TryFindFirstValue( "1", "<text not found>") ; }
        }
        
        
        public override string Caption {
            get { return base.Caption + " " + Text ; }
        }

    }
}
